<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.is.util.ParamUtil"%>
<%@page import="com.is.model.ParamStuyear"%>
<%@page import="com.is.control.ParamStuyearControl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../../resources/css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../resources/js/jquery-1.8.1.js"></script>
<script type="text/javascript" src="../../resources/js/jquery.artDialog.js"></script>
<title>开启学期</title>
</head>
<body>
<%
      String stuyear = ParamUtil.getString(request,"stuyear","");
      String startTime = ParamUtil.getString(request,"startTime","");
      String endTime = ParamUtil.getString(request,"endTime","");
      int typeId = ParamUtil.getInt(request,"stuyearType",0);
      if(!(stuyear.equals("")||startTime.equals("")||endTime.equals(""))){
           ParamStuyear ps = new ParamStuyear(stuyear,startTime,endTime,typeId);
           if(ParamStuyearControl.insertParamStuyear(ps)){
               %>
               <script>
               $.dialog({
				    title: '开启学年',
				    content: '本学期功能已成功开启，您可以开始本学年的教学工作',
				    icon: 'succeed',
				    ok: function(){
            	   		window.location.href="../paramClass/param_class_add.jsp";
				    }
				});
               </script>
               <%
           }else{
           %>
               <script>
               $.dialog({
				    title: '开启学年',
				    content: '抱歉，系统出现错误或您录入的信息有误</br>本学期功能未能成功开启，请检查所填参数是否符合要求',
				    icon: 'warning',
				    ok: function(){
				         history.go(-1);
				    }
				});
               </script>
               <%
           }
      }else{
       %>
            <script type="text/javascript">
            $.dialog({
			    title: '开启学年',
			    content: '抱歉，系统出现错误或您录入的信息有误</br>本学期功能未能成功开启，请检查所填参数是否符合要求',
			    icon: 'warning',
			    ok: function(){
			         history.go(-1);
			    }
			});
               </script>
               <%
      }
      
      

 %>
</body>
</html>